<template>
  <main-wrap>
    <div class="page msg_warn js_show">
      <div class="weui-msg">
          <div class="weui-msg__icon-area"><i class="weui-icon-warn weui-icon_msg"></i></div>
          <div class="weui-msg__text-area">
              <h2 class="weui-msg__title">{{title}}</h2>
              <p class="weui-msg__desc" v-if="msg !== ''">{{msg}}</p>
              <p class="weui-msg__desc" v-if="descri !== ''">{{descri}}</p>
          </div>
          <div class="weui-msg__opr-area">
              <p class="weui-btn-area">
                <router-link :to="mainbtnurl" class="weui-btn weui-btn_primary">{{mainbtntext}}</router-link>
                <router-link v-if="showsubbtn" :to="subbtnurl" class="weui-btn weui-btn_default">{{subbtntext}}</router-link>
              </p>
          </div>
      </div>
    </div>
  </main-wrap>
</template>

<script>
import MainWrap from '@/components/mainWrap'
export default {
  name: 'OperFail',
  components: {
    MainWrap
  },
  data () {
    return {
      title: this.$route.query.title ? this.$route.query.title : '操作失败',
      msg: this.$route.query.msg ? this.$route.query.msg : '',
      descri: this.$route.query.descri ? this.$route.query.descri : '',
      mainbtntext: this.$route.query.mainbtntext ? this.$route.query.mainbtntext : '回到首页',
      mainbtnurl: this.$route.query.mainbtnurl ? this.$route.query.mainbtnurl : '',
      showsubbtn: this.$route.query.showsubbtn ? this.$route.query.showsubbtn : false,
      subbtntext: this.$route.query.subbtntext ? this.$route.query.subbtntext : '',
      subbtnurl: this.$route.query.subbtnurl ? this.$route.query.subbtnurl : ''
    }
  }
}
</script>
